package com.hongyuan.sellfitness.ui.main.activity;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProviders;
import com.hongyuan.sellfitness.R;
import com.hongyuan.sellfitness.base.AppViewModelFactory;
import com.hongyuan.sellfitness.base.CustomActivity;
import com.hongyuan.sellfitness.databinding.ActivityStartupPageBinding;
import com.hongyuan.sellfitness.ui.main.view_mode.StartupPageViewModel;

import me.tatarka.bindingcollectionadapter2.BR;

public class StartupPageActivity extends CustomActivity<ActivityStartupPageBinding, StartupPageViewModel> {

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_startup_page;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public StartupPageViewModel initViewModel() {
        //使用自定义的ViewModelFactory来创建ViewModel，如果不重写该方法，则默认会调用LoginViewModel(@NonNull Application application)构造方法
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this, factory).get(StartupPageViewModel.class);
    }
}
